#ifndef GPLAYER_H
#define GPLAYER_H
#include <phonon/MediaObject>
#include <phonon/MediaSource>
#include <phonon/AudioOutput>
#include <phonon/path.h>
#include <QMainWindow>
#include <QFileDialog>
#include <QStringListModel>
#include <QSound>
#include <stdio.h>

namespace Ui {
    class gplayer;
}

class gplayer : public QMainWindow
{
    Q_OBJECT
    Phonon::MediaObject  *playing;
    Phonon::AudioOutput *audioOutput;
    QStringListModel playlistmodel;
    QStringList playlist;
    bool isPlaying;

    int currentplay;
public:
    explicit gplayer(QWidget *parent = 0);
    ~gplayer();
    QString playnow;
    void play(QString &file);
    virtual void show();
    int randInt(int low, int high)
        {
        // Random number between low and high
        return qrand() % ((high + 1) - low) + low;
        }
private slots:
    void on_butOpen_clicked();

    void on_butPlay_clicked();



    void play();
    void on_butStop_clicked();

    void on_playView_doubleClicked(const QModelIndex &index);

    void on_butNext_clicked();

    void on_butPrev_clicked();

    void on_butSavePlay_clicked();

    void on_butLoadPlay_clicked();


    void on_butUp_clicked();

    void on_buDown_clicked();

    void on_butRemove_clicked();

    void on_isShuffle_clicked();

public slots:

    void on_track_finished();

private:
    Ui::gplayer *ui;
};

#endif // GPLAYER_H
